<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        /*背景图水平垂直居中*/
        div {
            width: 400px;
            height: 400px;
            background-color: pink;
            background-image: url("https://ts1.cn.mm.bing.net/th?id=OIP-C.Rmu2HNfPTot9nN9kWt0dbgHaNK&w=187&h=333&c=8&rs=1&qlt=90&o=6&pid=3.1&rm=2");
            /*不让它平铺*/
            background-repeat: no-repeat;
            /*background-position: center center;*/
            background-position: center;
        }

        /*p 标签文字水平垂直居中*/
        div > p {
            text-align: center;
            line-height: 400px;
            color: red;
        }
    </style>
</head>
<body>
<div>
    <p>这是个p 标签</p>
</div>
</body>
</html>